For the latest tutorials, visit Weights & Biases on Google Cloud.
Do you want to experiment with Google AI models on Weave without any set up? Try the LLM Playground.
- Google GenAI SDK, which is accessible via Python SDK, Node.js SDK, Go SDK, and REST.
- Google Vertex AI API, which provides access to Google’s Gemini models and various partner models.
We also have support for the deprecated Google AI Python SDK for the Gemini API. Note that this support is deprecated as well and will be removed in a future version.
Get started
Weave will automatically capture traces for Google GenAI SDK. To start tracking, callingweave.init(project_name="<YOUR-WANDB-PROJECT-NAME>")
and use the library as normal.

weave.init(project_name="<YOUR-WANDB-PROJECT-NAME>")
and use the library as normal.
Track your own ops
Wrapping a function with@weave.op
starts capturing inputs, outputs and app logic so you can debug how data flows through your app. You can deeply nest ops and build a tree of functions that you want to track. This also starts automatically versioning code as you experiment to capture ad-hoc details that haven’t been committed to git.
Simply create a function decorated with @weave.op
.
In the example below, we have the function recommend_places_to_visit
which is a function wrapped with @weave.op
that recommends places to visit in a city.

Create a Model
for easier experimentation
Organizing experimentation is difficult when there are many moving pieces. By using the Model
class, you can capture and organize the experimental details of your app like your system prompt or the model you’re using. This helps organize and compare different iterations of your app.
In addition to versioning code and capturing inputs/outputs, Model
s capture structured parameters that control your application’s behavior, making it easy to find what parameters worked best. You can also use Weave Models with serve
, and Evaluation
s.
In the example below, you can experiment with CityVisitRecommender
. Every time you change one of these, you’ll get a new version of CityVisitRecommender
.